package com.zhanghao.sdk.ui.dialog;

import android.content.Context;
import android.content.DialogInterface;
import android.support.annotation.NonNull;
import android.view.KeyEvent;
import android.view.View;

import com.zhanghao.sdk.R;
import com.zhanghao.sdk.presenter.LoginPresenter;
import com.zhanghao.sdk.view.ILoginView;
import com.zhanghao.sdk.util.ZHLog;

import org.json.JSONObject;

public class LoginDialog extends BaseDialogView implements ILoginView {
    private LoginPresenter mLoginPresenter = new LoginPresenter(LoginDialog.this, LoginDialog.this);

    public LoginDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void bindLayout() {
        super.bindLayout(R.layout.zh_dialog_login);
    }

    @Override
    protected void initView() {
        super.initView();
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
    }

    @Override
    public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
        return super.onKey(dialog, keyCode, event);
    }

    @Override
    protected boolean onBackKey() {
        dismiss();
        return true;
    }

    @Override
    public String getUsername() {
        return "";
    }

    @Override
    public String getPassword() {
        return "";
    }

    @Override
    public void clearUsername() {

    }

    @Override
    public void clearPassword() {

    }

    @Override
    public String getCode() {
        return null;
    }

    @Override
    public void clearCode() {

    }

    @Override
    public String getCodeBtnTitle() {
        return null;
    }

    @Override
    public void setCodeBtnTitle(String title) {

    }

    @Override
    public void CodeBtnEnable(boolean isEnable) {

    }

    @Override
    public String getPhoneNumber() {
        return null;
    }

    @Override
    public String getType() {
        return null;
    }

    @Override
    public void clearType() {

    }

    @Override
    public void toResult(String flag, JSONObject jsonObject) {
        ZHLog.i("收到结果：" + jsonObject);
    }

    @Override
    public void showError(String flag, int code, String msg) {
        ZHLog.i("收到错误结果：[code = " + code + ", msg = [" + msg + "]");
    }
}
